<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
#{extends 'main.html' /}
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Questions Page</title>
<style type="text/css">
body {
	color: blue;
	background-color: #FFD700
}
</style>

</head>
<body>

	<!-- Mahmoud (view all questions with their titles and date of posting, 
		 with red for unanswered and green for answered questions)         -->

	<font face="Comic Sans MS"> <br>#{list items:questions, as:'question'}
		<div id="${question.id}">
			<br>
			<h4>
				<u>Title: ${question.title}</u>
			</h4>
			<h6>
				<u>Date & Time of post : ${question.questionDate}</u>
			</h6>

			#{ifnot question.hasReply}
			<h3>
				<u><a
					href="/Guidance/repliesPage.html?questionId=${question.id}"
					style="color: red">Question: ${question.questionContent}</a></u>
			</h3>
			#{/ifnot} #{else}
			<h3>
				<u><a
					href="/Guidance/repliesPage.html?questionId=${question.id}"
					style="color: green">Question: ${question.questionContent}</a></u>
			</h3>
			#{/else} __________________________________________________________
			___________________________________________________________
		</div> #{/list} <!-- end Mahmoud --> 
		
		<!-- (call method addQuestionToDatabase() from controller when clicked on submit)
		@ autor shayma  --> <!-- start Shayma -->

		<form action="@{Guidance.addQuestion()}" method="get">

			Title: <input type="text" name="title" id="title" /><br />
			 <span>#{error 'title' /}</span><br> Question: <input type="text"
				name="questionContent" id="questionContent" row="2" /><br /> 
				<span>#{error 'questionContent' /}</span><br>
				 <input type="submit" value="Post">

		</form> <!-- end Shayma -->

	</font>
</body>
</html>